package cn.yh.action;

import cn.yh.biz.AdminBiz;
import cn.yh.model.Admin;

public class AddAdminAction extends BaseAction {
	private String aname;
	private String apwd;
	private String age;

	public String execute() {
		AdminBiz ab = new AdminBiz();
		Admin ad = new Admin();
		int age = Integer.parseInt(this.age);
		ad.setAname(aname);
		ad.setApwd(apwd);
		ad.setAge(age);
		/*System.out.println(aname+","+apwd+","+age);*/
		int flag = ab.addAdmin(ad);
		
		if (flag > 0) {
			return "success";
		}
		return "fail";
	}

	public String getAname() {
		return aname;
	}

	public void setAname(String aname) {
		this.aname = aname;
	}

	public String getApwd() {
		return apwd;
	}

	public void setApwd(String apwd) {
		this.apwd = apwd;
	}

	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}



}
